02. Executing the Move Function

Moving in C++ and Python

In this example, we'll be comparing the execution speed of C++ and Python implementations of the move function that Kalman filters use to update their estimate of a car's location as it moves.

The move function does two things:

  1. It shifts a set of prior beliefs (about the car's location) in whichever direction the car moves.
  2. It adds some uncertainty to the beliefs because our model for car movement is not perfect.

A car is constantly moving, so this move function needs to be fast to keep up with the state of the car.

Execution vs. Development Time

You'll be comparing the execution time of the same move function implemented in Python and in C++. You're also encouraged to explore the code and think about how long it might take for you to program this function in either language; there is often a trade off between speed of execution and speed of development.